from app import db


class FoodCategory(db.Model):
    __tablename__ = 'food_category'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), nullable=False)
    weight = db.Column(db.Integer, nullable=False,comment="权重")
    status = db.Column(db.Integer, nullable=False,server_default="1",default=1)
    updated_time = db.Column(db.DateTime, nullable=False)
    created_time = db.Column(db.DateTime, nullable=False)

    food = db.relationship("Food",backref="category")